const {Schema, model} = require('mongoose');

const userSchema = new Schema({
    name: {type: String, required: true},
    email: {type: String, required: true},      
    password: {type: String, required: true},
    avatar: {type: String},
    technique: {type: String},
    experience: {type: String},
    credits: {type: Number, default: 0},
    posts: {type: Number, default: 0},
    likes: [{type: Schema.Types.ObjectId, ref: 'User'}],
    messages: [{
        text: { type: String, required: true },
        created: { type: Date, default: Date.now() },
    }],
}, {timestamps: true})

module.exports = model('User', userSchema);